<html>
<head>
  <title>03-字符集和比较规则</title>
  <basefont face="微软雅黑" size="2" />
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  <meta name="exporter-version" content="YXBJ Windows/600646 (zh-CN, DDL); Windows/6.1.1 (Win64);"/>
  <meta name="content-class" content="yinxiang.markdown"/>
  <style>
    body, td {
      font-family: 微软雅黑;
      font-size: 10pt;
    }
  </style>
</head>
<body>
<a name="621"/>
<h1>03-字符集和比较规则</h1>

<div><span><div style="font-size: 14px; margin: 0; padding: 0; width: 100%;"><h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">1. 字符集和比较规则</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">编码：</strong> 将一个字符串映射成一个二进制数据的过程叫做编码。<br/>
<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">解码：</strong> 将一个二进制数据映射成一个字符串的过程叫做解码。</p>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">1-1 常见字符集</h4>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">ASCII字符集（1个字节表示一个字符）</strong><br/>
共收录128个字符，包括空格、标点符号、数字、大小写字符和一些不可见字符。由于总共才128个字符，所以使用1个字节来进行编码。</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">ISO-8859-1字符集（1个字节表示一个字符）</strong><br/>
共收录256个字符，是在ASCII字符集的基础上又扩充了128个西欧常用字符（包括德法两国的子母），也适应1个字节进行编码，这个字符集有一个别名<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">latin1</strong>。</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">GB2312字符集（1~2个字节表示一个字符）</strong><br/>
收录了汉字以及拉丁子母、希腊子母、日文平假名及片假名子母、俄语西里尔子母。器中收录汉字6763个，其他文字符号682个。同时这种字符集又兼容ASCII字符集，所以在编码规则如下：<br/>
a. 如果该字符在ASCII字符集中，则采用1个字节表示一个字符；<br/>
b. 否则采用2个字节表示一个字符。</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">GBK字符集（1~2个字节表示一个字符）</strong><br/>
GBK字符集只是在收录字符范围上对GB2312进行了扩充，编码方式上兼容了GB2312。</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">UTF-8字符集（1~4个字节表示一个字符）</strong><br/>
收录地球上能想到的所有字符，而且还在不断扩充。这种字符集兼容了ASCII字符集，采用变长编码方式。编码一个字符需要使用1~4个字节。<br/>
准确的说，<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">utf8只是Unicode字符集的一种编码方案</strong>，Unicode字符集可以采用utf8、utf16、utf32这几种编码方案，utf8使用1～4个字节编码一个字符，utf16使用2个或4个字节编码一个字符，utf32使用4个字节编码一个字符。更详细的Unicode和其编码方案的知识不是本书的重点，大家上网查查哈～ MySQL中并不区分字符集和编码方案的概念，所以后边唠叨的时候把utf8、utf16、utf32都当作一种字符集对待。</p>
</li>
</ul>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">1-2 MySQL中的字符集和排序规则</h4>
<h5 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 16px; color: #333;">1-2-1 MySQL中的utf8和utf8mb4</h5>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">utf8字符集表示一个字符需要使用1～4个字节，但是我们常用的一些字符使用1～3个字节就可以表示了。而在MySQL中字符集表示一个字符所用最大字节长度在某些方面会影响系统的存储和性能：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">utf8mb3：阉割过的utf8字符集，只使用1~3个字节表示字符；</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">utf8mb4：正宗的utf8字符集，使用1~4个字节表示字符；</li>
</ul>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">在MySQL中utf8是utf8mb3的别名</strong>，所以在MySQL中提到utf8就意味着使用1~3个字节来表示一个字符。如果有使用4字节编码一个字符的情况，比如存储一些emoji表情啥的，那请使用utf8mb4。</p>
<h5 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 16px; color: #333;">1-2-2 字符集的查看</h5>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">查看当前MySQL版本中支持的字符集：</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><code style="line-height: 160%; box-sizing: content-box; border: 0; border-radius: 0; color: #c1788b; padding: 4px 4px 2px 0; letter-spacing: -.3px;">SHOW ( CHARACTER SET| CHARSET) [LIKE 匹配的模式]</code>；</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">Default collation：表示这种字符集默认的比较规则；</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">Maxlen：它代表该种字符集表示一个字符最多需要几个字节；<br/>
| 字符集名称 | Maxlen |<br/>
| --- | --- |<br/>
| ascii | 1 |<br/>
| latin1 | 1 |<br/>
| gb2312 | 2 |<br/>
| gbk | 2 |<br/>
| utf8 | 3 |<br/>
| utf8mb4 | 4 |</li>
</ul>
<h5 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 16px; color: #333;">1-2-3 比较规则的查看</h5>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">查看当前MySQL版本中支持的字符集：</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><code style="line-height: 160%; box-sizing: content-box; border: 0; border-radius: 0; color: #c1788b; padding: 4px 4px 2px 0; letter-spacing: -.3px;">SHOW COLLATION [LIKE 匹配的模式]</code>；</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">比较规则名称以与其关联的字符集的名称开头；</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">后边紧跟着该比较规则主要作用于哪种语言；</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">名称后缀意味着该比较规则是否区分语言中的重音、大小写啥的，具体可以用的值如下：<br/>
| 后缀 | 描述 |<br/>
| --- | --- |<br/>
| _ai | 不区分重音 |<br/>
| _as | 区分重音 |<br/>
| _ci | 不区分大小写 |<br/>
| _cs | 区分大小写 |<br/>
| _bin | 以二进制方式比较 |</li>
</ul>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">2. 字符集和比较规则的应用</h3>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">2-1 MySQL各级别的字符集和比较规则</h4>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">MySQL有4个级别的字符集和比较规则：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">服务器级别</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">数据库级别</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">表级别</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">列级别</li>
</ul>
<h5 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 16px; color: #333;">服务器级别</h5>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">MySQL提供了两个系统变量来表示服务器级别的字符集和比较规则：</p>
<table style="margin: 2px 0 14px; color: #333; width: auto; border-collapse: collapse; box-sizing: border-box;"><thead style="line-height: 160%; box-sizing: content-box;"><tr style="line-height: 160%; box-sizing: content-box;"><th style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #72777b; border-top: 0; background-color: #7b8184; font-weight: 300; color: #fff; padding-top: 6px;">系统变量</th><th style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #72777b; border-top: 0; background-color: #7b8184; font-weight: 300; color: #fff; padding-top: 6px;">描述</th></tr></thead><tbody style="line-height: 160%; box-sizing: content-box;"><tr style="line-height: 160%; box-sizing: content-box;"><td style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #eaeaea;">character_set_server</td><td style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #eaeaea;">服务器级别的字符集</td></tr><tr style="line-height: 160%; box-sizing: content-box;"><td style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #eaeaea;">collation_server</td><td style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #eaeaea;">服务器级别的比较规则</td></tr></tbody></table>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">可以在启动服务器程序时通过<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">启动选项</strong>或者在服务器程序运行过程中使用<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">SET语句</strong>修改这两个变量的值。<br/>
通过启动选项以配置文件的形式加载，例：</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">[server]<br/>
character_set_server=gbk<br/>
collation_server=gbk_chinese_ci</p>
<h5 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 16px; color: #333;">数据库级别</h5>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">在创建和修改数据库时可以指定该数据库的字符集和比较规则，具体语法如下：</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">CREATE DATABASE 数据库名</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">[( CHARACTER SET | CHARSET ) [=] 字符集名称]</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">[COLLATE [=] 比较规则名称];</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">ALTER DATABASE 数据库名</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">[ ( CHARACTER SET | CHARSET ) [=] 字符集名称]</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">[ COLLATE [=] 比较规则名称];<br/>
如果创建数据库时不指定使用的字符集和比较规则，那么默认使用服务器级别的字符集和比较规则</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">如果想查看当前数据库使用的字符集和比较规则，可以查看下面两个系统变量的值（前提是使用USE语句选择当前默认数据库，如果没有默认数据库，则变量与相应的服务器级系统变量具有相同的值）：</p>
<table style="margin: 2px 0 14px; color: #333; width: auto; border-collapse: collapse; box-sizing: border-box;"><thead style="line-height: 160%; box-sizing: content-box;"><tr style="line-height: 160%; box-sizing: content-box;"><th style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #72777b; border-top: 0; background-color: #7b8184; font-weight: 300; color: #fff; padding-top: 6px;">系统变量</th><th style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #72777b; border-top: 0; background-color: #7b8184; font-weight: 300; color: #fff; padding-top: 6px;">描述</th></tr></thead><tbody style="line-height: 160%; box-sizing: content-box;"><tr style="line-height: 160%; box-sizing: content-box;"><td style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #eaeaea;">character_set_database</td><td style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #eaeaea;">当前数据库的字符集</td></tr><tr style="line-height: 160%; box-sizing: content-box;"><td style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #eaeaea;">collation_database</td><td style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #eaeaea;">当前数据库的比较规则</td></tr></tbody></table>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">character_set_database 和 collation_database 这两个系统变量是只读的，我们不能通过修改这两个变量的值而改变当前数据库的字符集和比较规则</strong></p>
<h5 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 16px; color: #333;">表级别</h5>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">我们也可以在创建和修改表的时候指定表的字符集和比较规则，语法如下：</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">CREATE TABLE 表名</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">[( CHARACTER SET | CHARSET ) [=] 字符集名称]</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">[COLLATE [=] 比较规则名称];</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">ALTER TABLE 表名</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">[ ( CHARACTER SET | CHARSET ) [=] 字符集名称]</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">[ COLLATE [=] 比较规则名称];<br/>
如果创建表时不指定使用的字符集和比较规则，那么默认使用表所在数据库的数据库级别的字符集和比较规则；</p>
<h5 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 16px; color: #333;">列级别</h5>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">需要注意的是，对于存储字符串的列，同一个表中的不同的列也可以有不同的字符集和比较规则，<br/>
在创建和修改列定义的时候可以指定该列的字符集和比较规则，语法如下：</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">CREATE TABLE 表名(<br/>
列名 字符串类型 [CHARACTER SET 字符集名称] [COLLATE 比较规则名称],<br/>
其他列...<br/>
);</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">ALTER TABLE 表名 MODIFY 列名 字符串类型 [ CHARACTER SET 字符集名称 ]  [ COLLATE 比较规则名称 ]；</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">对于某个列来说，如果在创建和修改的语句中没有指明字符集和比较规则，将使用该列所在表的字符集和比较规则作为该列的字符集和比较规则</p>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">2-2 MySQL中字符集的转换</h4>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">字符集转换的概念</strong>：<br/>
将一个字节串先用A字符集解码，再用B字符集编码，得到新字节串的过程称为字符集的转换。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">从客户端发送请求到服务器返回的过程中伴随着多次字符集的转换，这个过程涉及到3个针对客户端的系统变量：</p>
<table style="margin: 2px 0 14px; color: #333; width: auto; border-collapse: collapse; box-sizing: border-box;"><thead style="line-height: 160%; box-sizing: content-box;"><tr style="line-height: 160%; box-sizing: content-box;"><th style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #72777b; border-top: 0; background-color: #7b8184; font-weight: 300; color: #fff; padding-top: 6px;">变量名称</th><th style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #72777b; border-top: 0; background-color: #7b8184; font-weight: 300; color: #fff; padding-top: 6px;">描述</th></tr></thead><tbody style="line-height: 160%; box-sizing: content-box;"><tr style="line-height: 160%; box-sizing: content-box;"><td style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #eaeaea;">character_set_client</td><td style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #eaeaea;">服务器解码请求时使用的字符集</td></tr><tr style="line-height: 160%; box-sizing: content-box;"><td style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #eaeaea;">character_set_connection</td><td style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #eaeaea;">服务器处理请求时会把请求字符串从character_set_client转为character_set_connection</td></tr><tr style="line-height: 160%; box-sizing: content-box;"><td style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #eaeaea;">character_set_results</td><td style="line-height: 160%; box-sizing: content-box; padding: 5px 14px 5px 12px; border: 1px solid #eaeaea;">服务器向客户端返回时使用的字符集</td></tr></tbody></table>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">将上述3个系统变量设置成同一字符集的方法：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;">方法1：<br/>
SET NAMES  字符集；<br/>
注意，此命令中NAMES不是系统变量，而且与字符集参数间不能用=连接</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;">方法2：<br/>
SET CHARACTER_SET_CLIENT=字符集<br/>
SET CHARACTER_SET_CONNECTION=字符集<br/>
SET CHARACTER_SET_RESULTS=字符集</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;">方法3：<br/>
配置文件中：[mysql | client ]组下，default-character-set=字符集</p>
</li>
</ul>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">现在看一下在请求从发送到结果返回过程中字符集的变化：</strong></p>
<ol style="line-height: 160%; box-sizing: content-box; display: block; padding-left: 30px; margin: 6px 0 10px; color: #333; list-style-type: decimal;">
<li style="line-height: 160%; box-sizing: content-box;">客户端发送请求所使用的字符集<br/>
一般情况下客户端所使用的字符集和当前操作系统一致，不同操作系统使用的字符集可能不一样，如下：</li>
</ol>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">类Unix系统使用的是utf8</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">Windows使用的是gbk</li>
</ul>
<ol start="2" style="line-height: 160%; box-sizing: content-box; display: block; padding-left: 30px; margin: 6px 0 10px; color: #333; list-style-type: decimal;">
<li style="line-height: 160%; box-sizing: content-box;">服务器接收到客户端发送来的请求其实是一串二进制的字节，它会认为这串字节采用的字符集是character_set_client，将二进制字节串采用character_set_client字符集进行解码，得到字符串；</li>
<li style="line-height: 160%; box-sizing: content-box;">然后通过character_set_connection字符集对字符串进行编码，得到二进制字节串，通过该二进制字节串去表中进行列值处理（如果列使用的字符集和character_set_connection字符集不一致，还需要再进行一次转换）</li>
<li style="line-height: 160%; box-sizing: content-box;">上一步中找到的列值其实是一个二进制字节串，然后再使用列的字符集进行解码，得到字符串，再通过character_set_results进行编码，得到二进制字节串返回给客户端；</li>
<li style="line-height: 160%; box-sizing: content-box;">客户端根据返回的二进制字节串，采用客户端默认的字符集进行解码，得到字符展示给用户；</li>
</ol>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">通过上面的分析：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;">服务器认为客户端发送过来的请求是用character_set_client编码的。<br/>
假设你的客户端采用的字符集和 character_set_client 不一样的话，这就会出现意想不到的情况。比如我的客户端使用的是utf8字符集，如果把系统变量character_set_client的值设置为ascii的话，服务器可能无法理解我们发送的请求，更别谈处理这个请求了。</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;">服务器将把得到的结果集使用character_set_results编码后发送给客户端。<br/>
假设你的客户端采用的字符集和 character_set_results 不一样的话，这就可能会出现客户端无法解码结果集的情况，结果就是在你的屏幕上出现乱码。比如我的客户端使用的是utf8字符集，如果把系统变量character_set_results的值设置为ascii的话，可能会产生乱码。</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;">character_set_connection只是服务器在将请求的字节串从character_set_client转换为character_set_connection时使用，它是什么其实没多重要，但是一定要注意，该字符集包含的字符范围一定涵盖请求中的字符，要不然会导致有的字符无法使用character_set_connection代表的字符集进行编码。比如你把character_set_client设置为utf8，把character_set_connection设置成ascii，那么此时你如果从客户端发送一个汉字到服务器，那么服务器无法使用ascii字符集来编码这个汉字，就会向用户发出一个警告。</p>
</li>
</ul>
</div><center style="display:none !important;visibility:collapse !important;height:0 !important;white-space:nowrap;width:100%;overflow:hidden">%23%23%23%201.%20%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%0A**%E7%BC%96%E7%A0%81%EF%BC%9A**%20%E5%B0%86%E4%B8%80%E4%B8%AA%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%98%A0%E5%B0%84%E6%88%90%E4%B8%80%E4%B8%AA%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89%A9%E5%85%85%EF%BC%8C%E7%BC%96%E7%A0%81%E6%96%B9%E5%BC%8F%E4%B8%8A%E5%85%BC%E5%AE%B9%E4%BA%86GB2312%E3%80%82%0A%0A*%20**UTF-8%E5%AD%97%E7%AC%A6%E9%9B%86%EF%BC%881~4%E4%B8%AA%E5%AD%97%E8%8A%82%E8%A1%A8%E7%A4%BA%E4%B8%80%E4%B8%AA%E5%AD%97%E7%AC%A6%EF%BC%89**%0A%E6%94%B6%E5%BD%95%E5%9C%B0%E7%90%83%E4%B8%8A%E8%83%BD%E6%83%B3%E5%88%B0%E7%9A%84%E6%89%80%E6%9C%89%E5%AD%97%E7%AC%A6%EF%BC%8C%E8%80%8C%E4%B8%94%E8%BF%98%E5%9C%A8%E4%B8%8D%E6%96%AD%E6%89%A9%E5%85%85%E3%80%82%E8%BF%99%E7%A7%8D%E5%AD%97%E7%AC%A6%E9%9B%86%E5%85%BC%E5%AE%B9%E4%BA%86ASCII%E5%AD%97%E7%AC%A6%E9%9B%86%EF%BC%8C%E9%87%87%E7%94%A8%E5%8F%98%E9%95%BF%E7%BC%96%E7%A0%81%E6%96%B9%E5%BC%8F%E3%80%82%E7%BC%96%E7%A0%81%E4%B8%80%E4%B8%AA%E5%AD%97%E7%AC%A6%E9%9C%80%E8%A6%81%E4%BD%BF%E7%94%A81~4%E4%B8%AA%E5%AD%97%E8%8A%82%E3%80%82%0A%E5%87%86%E7%A1%AE%E7%9A%84%E8%AF%B4%EF%BC%8C**utf8%E5%8F%AA%E6%98%AFUnicode%E5%AD%97%E7%AC%A6%E9%9B%86%E7%9A%84%E4%B8%80%E7%A7%8D%E7%BC%96%E7%A0%81%E6%96%B9%E6%A1%88**%EF%BC%8CUnicode%E5%AD%97%E7%AC%A6%E9%9B%86%E5%8F%AF%E4%BB%A5%E9%87%87%E7%94%A8utf8%E3%80%81utf16%E3%80%81utf32%E8%BF%99%E5%87%A0%E7%A7%8D%E7%BC%96%E7%A0%81%E6%96%B9%E6%A1%88%EF%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BC%8C%E4%BD%BF%E7%94%A81~4%E4%B8%AA%E5%AD%97%E8%8A%82%E8%A1%A8%E7%A4%BA%E5%AD%97%E7%AC%A6%EF%BC%9B%0A%0A**%E5%9C%A8MySQL%E4%B8%ADutf8%E6%98%AFutf8mb3%E7%9A%84%E5%88%AB%E5%90%8D**%EF%BC%8C%E6%89%80%E4%BB%A5%E5%9C%A8MySQL%E4%B8%AD%E6%8F%90%E5%88%B0utf8%E5%B0%B1%E6%84%8F%E5%91%B3%E7%9D%80%E4%BD%BF%E7%94%A81~3%E4%B8%AA%E5%AD%97%E8%8A%82%E6%9D%A5%E8%A1%A8%E7%A4%BA%E4%B8%80%E4%B8%AA%E5%AD%97%E7%AC%A6%E3%80%82%E5%A6%82%E6%9E%9C%E6%9C%89%E4%BD%BF%E7%94%A84%E5%AD%97%E8%8A%82%E7%BC%96%E7%A0%81%E4%B8%80%E4%B8%AA%E5%AD%97%E7%AC%A6%E7%9A%84%E6%83%85%E5%86%B5%EF%BC%8C%E6%AF%94%E5%A6%82%E5%AD%98%E5%82%A8%E4%B8%80%E4%BA%9Bemoji%E8%A1%A8%E6%83%85%E5%95%A5%E7%9A%84%EF%BC%8C%E9%82%A3%E8%AF%B7%E4%BD%BF%E7%94%A8utf8mb4%E3%80%82%0A%0A%23%23%23%23%23%201-2-2%20%E5%AD%97%E7%AC%A6%E9%9B%86%E7%9A%84%E6%9F%A5%E7%9C%8B%0A%0A%E6%9F%A5%E7%9C%8B%E5%BD%93%E5%89%8DMySQL%E7%89%88%E6%9C%AC%E4%B8%AD%E6%94%AF%E6%8C%81%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%EF%BC%9A%0A%0A%60SHOW%20%20(%20CHARACTER%20SET%7C%20CHARSET)%20%5BLIKE%20%E5%8C%B9%E9%85%8D%E7%9A%84%E6%A8%A1%E5%BC%8F%5D%60%EF%BC%9B%0A%0A*%20Default%20collation%EF%BC%9A%E8%A1%A8%E7%A4%BA%E8%BF%99%E7%A7%8D%E5%AD%97%E7%AC%A6%E9%9B%86%E9%BB%98%E8%AE%A4%E7%9A%84%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%EF%BC%9B%0A*%20Maxlen%EF%BC%9A%E5%AE%83%E4%BB%A3%E8%A1%A8%E8%AF%A5%E7%A7%8D%E5%AD%97%E7%AC%A6%E9%9B%86%E8%A1%A8%E7%A4%BA%E4%B8%80%E4%B8%AA%E5%AD%97%E7%AC%A6%E6%9C%80%E5%A4%9A%E9%9C%80%E8%A6%81%E5%87%A0%E4%B8%AA%E5%AD%97%E8%8A%82%EF%BC%9B%0A%7C%20%E5%AD%97%E7%AC%A6%E9%9B%86%E5%90%8D%E7%A7%B0%20%7C%20Maxlen%20%7C%0A%7C%20---%20%7C%20---%20%7C%0A%7C%20ascii%20%7C%201%20%7C%0A%7C%20latin1%20%7C%201%20%7C%0A%7C%20gb2312%20%7C%202%20%7C%0A%7C%20gbk%20%7C%202%20%7C%0A%7C%20utf8%20%7C%203%20%7C%0A%7C%20utf8mb4%20%7C%204%20%7C%0A%0A%23%23%23%23%23%201-2-3%20%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%E7%9A%84%E6%9F%A5%E7%9C%8B%0A%E6%9F%A5%E7%9C%8B%E5%BD%93%E5%89%8DMySQL%E7%89%88%E6%9C%AC%E4%B8%AD%E6%94%AF%E6%8C%81%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%EF%BC%9A%0A%0A%60SHOW%20COLLATION%20%5BLIKE%20%E5%8C%B9%E9%85%8D%E7%9A%84%E6%A8%A1%E5%BC%8F%5D%60%EF%BC%9B%0A%0A*%20%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%E5%90%8D%E7%A7%B0%E4%BB%A5%E4%B8%8E%E5%85%B6%E5%85%B3%E8%81%94%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E7%9A%84%E5%90%8D%E7%A7%B0%E5%BC%80%E5%A4%B4%EF%BC%9B%0A*%20%E5%90%8E%E8%BE%B9%E7%B4%A7%E8%B7%9F%E7%9D%80%E8%AF%A5%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%E4%B8%BB%E8%A6%81%E4%BD%9C%E7%94%A8%E4%BA%8E%E5%93%AA%E7%A7%8D%E8%AF%AD%E8%A8%80%EF%BC%9B%0A*%20%E5%90%8D%E7%A7%B0%E5%90%8E%E7%BC%80%E6%84%8F%E5%91%B3%E7%9D%80%E8%AF%A5%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%E6%98%AF%E5%90%A6%E5%8C%BA%E5%88%86%E8%AF%AD%E8%A8%80%E4%B8%AD%E7%9A%84%E9%87%8D%E9%9F%B3%E3%80%81%E5%A4%A7%E5%B0%8F%E5%86%99%E5%95%A5%E7%9A%84%EF%BC%8C%E5%85%B7%E4%BD%93%E5%8F%AF%E4%BB%A5%E7%94%A8%E7%9A%84%E5%80%BC%E5%A6%82%E4%B8%8B%EF%BC%9A%0A%7C%20%E5%90%8E%E7%BC%80%20%7C%20%E6%8F%8F%E8%BF%B0%20%7C%0A%7C%20---%20%7C%20---%20%7C%0A%7C%20_ai%20%7C%20%E4%B8%8D%E5%8C%BA%E5%88%86%E9%87%8D%E9%9F%B3%20%7C%0A%7C%20_as%20%7C%20%E5%8C%BA%E5%88%86%E9%87%8D%E9%9F%B3%20%7C%0A%7C%20_ci%20%7C%20%E4%B8%8D%E5%8C%BA%E5%88%86%E5%A4%A7%E5%B0%8F%E5%86%99%20%7C%0A%7C%20_cs%20%7C%20%E5%8C%BA%E5%88%86%E5%A4%A7%E5%B0%8F%E5%86%99%20%7C%0A%7C%20_bin%20%7C%20%E4%BB%A5%E4%BA%8C%E8%BF%9B%E5%88%B6%E6%96%B9%E5%BC%8F%E6%AF%94%E8%BE%83%20%7C%0A%0A%23%23%23%202.%20%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%E7%9A%84%E5%BA%94%E7%94%A8%0A%0A%23%23%23%23%202-1%20MySQL%E5%90%84%E7%BA%A7%E5%88%AB%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%0A%0AMySQL%E6%9C%894%E4%B8%AA%E7%BA%A7%E5%88%AB%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%EF%BC%9A%0A%0A*%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%BA%A7%E5%88%AB%0A*%20%E6%95%B0%E6%8D%AE%E5%BA%93%E7%BA%A7%E5%88%AB%0A*%20%E8%A1%A8%E7%BA%A7%E5%88%AB%0A*%20%E5%88%97%E7%BA%A7%E5%88%AB%0A%0A%23%23%23%23%23%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%BA%A7%E5%88%AB%0A%0AMySQL%E6%8F%90%E4%BE%9B%E4%BA%86%E4%B8%A4%E4%B8%AA%E7%B3%BB%E7%BB%9F%E5%8F%98%E9%87%8F%E6%9D%A5%E8%A1%A8%E7%A4%BA%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%BA%A7%E5%88%AB%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%EF%BC%9A%0A%0A%7C%20%E7%B3%BB%E7%BB%9F%E5%8F%98%E9%87%8F%20%7C%20%E6%8F%8F%E8%BF%B0%20%7C%0A%7C%20---%20%7C%20---%20%7C%0A%7C%20character_set_server%20%7C%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%BA%A7%E5%88%AB%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%20%7C%0A%7C%20collation_server%20%7C%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%BA%A7%E5%88%AB%E7%9A%84%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%20%7C%0A%0A%E5%8F%AF%E4%BB%A5%E5%9C%A8%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%A8%8B%E5%BA%8F%E6%97%B6%E9%80%9A%E8%BF%87**%E5%90%AF%E5%8A%A8%E9%80%89%E9%A1%B9**%E6%88%96%E8%80%85%E5%9C%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%A8%8B%E5%BA%8F%E8%BF%90%E8%A1%8C%E8%BF%87%E7%A8%8B%E4%B8%AD%E4%BD%BF%E7%94%A8**SET%E8%AF%AD%E5%8F%A5**%E4%BF%AE%E6%94%B9%E8%BF%99%E4%B8%A4%E4%B8%AA%E5%8F%98%E9%87%8F%E7%9A%84%E5%80%BC%E3%80%82%0A%E9%80%9A%E8%BF%87%E5%90%AF%E5%8A%A8%E9%80%89%E9%A1%B9%E4%BB%A5%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E7%9A%84%E5%BD%A2%E5%BC%8F%E5%8A%A0%E8%BD%BD%EF%BC%8C%E4%BE%8B%EF%BC%9A%0A%0A%5Bserver%5D%20%0Acharacter_set_server%3Dgbk%20%0Acollation_server%3Dgbk_chinese_ci%0A%0A%23%23%23%23%23%20%E6%95%B0%E6%8D%AE%E5%BA%93%E7%BA%A7%E5%88%AB%0A%E5%9C%A8%E5%88%9B%E5%BB%BA%E5%92%8C%E4%BF%AE%E6%94%B9%E6%95%B0%E6%8D%AE%E5%BA%93%E6%97%B6%E5%8F%AF%E4%BB%A5%E6%8C%87%E5%AE%9A%E8%AF%A5%E6%95%B0%E6%8D%AE%E5%BA%93%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%EF%BC%8C%E5%85%B7%E4%BD%93%E8%AF%AD%E6%B3%95%E5%A6%82%E4%B8%8B%EF%BC%9A%0A%0ACREATE%20DATABASE%20%E6%95%B0%E6%8D%AE%E5%BA%93%E5%90%8D%20%0A%5B(%20CHARACTER%20SET%20%7C%20CHARSET%20)%20%5B%3D%5D%20%E5%AD%97%E7%AC%A6%E9%9B%86%E5%90%8D%E7%A7%B0%5D%20%0A%5BCOLLATE%20%5B%3D%5D%20%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%E5%90%8D%E7%A7%B0%5D%3B%20%0A%0AALTER%20DATABASE%20%E6%95%B0%E6%8D%AE%E5%BA%93%E5%90%8D%20%0A%5B%20(%20CHARACTER%20SET%20%7C%20CHARSET%20)%20%5B%3D%5D%20%E5%AD%97%E7%AC%A6%E9%9B%86%E5%90%8D%E7%A7%B0%5D%20%0A%5B%20COLLATE%20%5B%3D%5D%20%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%E5%90%8D%E7%A7%B0%5D%3B%0A%E5%A6%82%E6%9E%9C%E5%88%9B%E5%BB%BA%E6%95%B0%E6%8D%AE%E5%BA%93%E6%97%B6%E4%B8%8D%E6%8C%87%E5%AE%9A%E4%BD%BF%E7%94%A8%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%EF%BC%8C%E9%82%A3%E4%B9%88%E9%BB%98%E8%AE%A4%E4%BD%BF%E7%94%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%BA%A7%E5%88%AB%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%0A%0A%E5%A6%82%E6%9E%9C%E6%83%B3%E6%9F%A5%E7%9C%8B%E5%BD%93%E5%89%8D%E6%95%B0%E6%8D%AE%E5%BA%93%E4%BD%BF%E7%94%A8%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%EF%BC%8C%E5%8F%AF%E4%BB%A5%E6%9F%A5%E7%9C%8B%E4%B8%8B%E9%9D%A2%E4%B8%A4%E4%B8%AA%E7%B3%BB%E7%BB%9F%E5%8F%98%E9%87%8F%E7%9A%84%E5%80%BC%EF%BC%88%E5%89%8D%E6%8F%90%E6%98%AF%E4%BD%BF%E7%94%A8USE%E8%AF%AD%E5%8F%A5%E9%80%89%E6%8B%A9%E5%BD%93%E5%89%8D%E9%BB%98%E8%AE%A4%E6%95%B0%E6%8D%AE%E5%BA%93%EF%BC%8C%E5%A6%82%E6%9E%9C%E6%B2%A1%E6%9C%89%E9%BB%98%E8%AE%A4%E6%95%B0%E6%8D%AE%E5%BA%93%EF%BC%8C%E5%88%99%E5%8F%98%E9%87%8F%E4%B8%8E%E7%9B%B8%E5%BA%94%E7%9A%84%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%BA%A7%E7%B3%BB%E7%BB%9F%E5%8F%98%E9%87%8F%E5%85%B7%E6%9C%89%E7%9B%B8%E5%90%8C%E7%9A%84%E5%80%BC%EF%BC%89%EF%BC%9A%0A%7C%20%E7%B3%BB%E7%BB%9F%E5%8F%98%E9%87%8F%20%7C%20%E6%8F%8F%E8%BF%B0%20%7C%0A%7C%20---%20%7C%20---%20%7C%0A%7C%20character_set_database%20%7C%20%E5%BD%93%E5%89%8D%E6%95%B0%E6%8D%AE%E5%BA%93%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%20%7C%0A%7C%20collation_database%20%7C%20%E5%BD%93%E5%89%8D%E6%95%B0%E6%8D%AE%E5%BA%93%E7%9A%84%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%20%7C%0A%0A**haracter_set_database%C2%A0%E5%92%8C%C2%A0collation_database%C2%A0%E8%BF%99%E4%B8%A4%E4%B8%AA%E7%B3%BB%E7%BB%9F%E5%8F%98%E9%87%8F%E6%98%AF%E5%8F%AA%E8%AF%BB%E7%9A%84%EF%BC%8C%E6%88%91%E4%BB%AC%E4%B8%8D%E8%83%BD%E9%80%9A%E8%BF%87%E4%BF%AE%E6%94%B9%E8%BF%99%E4%B8%A4%E4%B8%AA%E5%8F%98%E9%87%8F%E7%9A%84%E5%80%BC%E8%80%8C%E6%94%B9%E5%8F%98%E5%BD%93%E5%89%8D%E6%95%B0%E6%8D%AE%E5%BA%93%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99**%0A%0A%23%23%23%23%23%20%E8%A1%A8%E7%BA%A7%E5%88%AB%0A%E6%88%91%E4%BB%AC%E4%B9%9F%E5%8F%AF%E4%BB%A5%E5%9C%A8%E5%88%9B%E5%BB%BA%E5%92%8C%E4%BF%AE%E6%94%B9%E8%A1%A8%E7%9A%84%E6%97%B6%E5%80%99%E6%8C%87%E5%AE%9A%E8%A1%A8%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%EF%BC%8C%E8%AF%AD%E6%B3%95%E5%A6%82%E4%B8%8B%EF%BC%9A%0A%0ACREATE%20TABLE%20%E8%A1%A8%E5%90%8D%20%0A%5B(%20CHARACTER%20SET%20%7C%20CHARSET%20)%20%5B%3D%5D%20%E5%AD%97%E7%AC%A6%E9%9B%86%E5%90%8D%E7%A7%B0%5D%20%0A%5BCOLLATE%20%5B%3D%5D%20%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%E5%90%8D%E7%A7%B0%5D%3B%20%0A%0AALTER%20TABLE%20%E8%A1%A8%E5%90%8D%0A%5B%20(%20CHARACTER%20SET%20%7C%20CHARSET%20)%20%5B%3D%5D%20%E5%AD%97%E7%AC%A6%E9%9B%86%E5%90%8D%E7%A7%B0%5D%20%0A%5B%20COLLATE%20%5B%3D%5D%20%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%E5%90%8D%E7%A7%B0%5D%3B%0A%E5%A6%82%E6%9E%9C%E5%88%9B%E5%BB%BA%E8%A1%A8%E6%97%B6%E4%B8%8D%E6%8C%87%E5%AE%9A%E4%BD%BF%E7%94%A8%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%EF%BC%8C%E9%82%A3%E4%B9%88%E9%BB%98%E8%AE%A4%E4%BD%BF%E7%94%A8%E8%A1%A8%E6%89%80%E5%9C%A8%E6%95%B0%E6%8D%AE%E5%BA%93%E7%9A%84%E6%95%B0%E6%8D%AE%E5%BA%93%E7%BA%A7%E5%88%AB%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%EF%BC%9B%0A%0A%23%23%23%23%23%20%E5%88%97%E7%BA%A7%E5%88%AB%0A%0A%E9%9C%80%E8%A6%81%E6%B3%A8%E6%84%8F%E7%9A%84%E6%98%AF%EF%BC%8C%E5%AF%B9%E4%BA%8E%E5%AD%98%E5%82%A8%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%9A%84%E5%88%97%EF%BC%8C%E5%90%8C%E4%B8%80%E4%B8%AA%E8%A1%A8%E4%B8%AD%E7%9A%84%E4%B8%8D%E5%90%8C%E7%9A%84%E5%88%97%E4%B9%9F%E5%8F%AF%E4%BB%A5%E6%9C%89%E4%B8%8D%E5%90%8C%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%EF%BC%8C%0A%E5%9C%A8%E5%88%9B%E5%BB%BA%E5%92%8C%E4%BF%AE%E6%94%B9%E5%88%97%E5%AE%9A%E4%B9%89%E7%9A%84%E6%97%B6%E5%80%99%E5%8F%AF%E4%BB%A5%E6%8C%87%E5%AE%9A%E8%AF%A5%E5%88%97%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%EF%BC%8C%E8%AF%AD%E6%B3%95%E5%A6%82%E4%B8%8B%EF%BC%9A%0A%0ACREATE%20TABLE%20%E8%A1%A8%E5%90%8D(%0A%20%20%20%20%E5%88%97%E5%90%8D%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%B1%BB%E5%9E%8B%20%5BCHARACTER%20SET%20%E5%AD%97%E7%AC%A6%E9%9B%86%E5%90%8D%E7%A7%B0%5D%20%5BCOLLATE%20%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%E5%90%8D%E7%A7%B0%5D%2C%0A%20%20%20%20%E5%85%B6%E4%BB%96%E5%88%97...%0A%20%20%20%20)%3B%20%0A%20%20%20%20%0A%20ALTER%20TABLE%20%E8%A1%A8%E5%90%8D%20MODIFY%20%E5%88%97%E5%90%8D%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%B1%BB%E5%9E%8B%20%5B%20CHARACTER%20SET%20%E5%AD%97%E7%AC%A6%E9%9B%86%E5%90%8D%E7%A7%B0%20%5D%20%20%5B%20COLLATE%20%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%E5%90%8D%E7%A7%B0%20%5D%EF%BC%9B%0A%20%0A%20%0A%E5%AF%B9%E4%BA%8E%E6%9F%90%E4%B8%AA%E5%88%97%E6%9D%A5%E8%AF%B4%EF%BC%8C%E5%A6%82%E6%9E%9C%E5%9C%A8%E5%88%9B%E5%BB%BA%E5%92%8C%E4%BF%AE%E6%94%B9%E7%9A%84%E8%AF%AD%E5%8F%A5%E4%B8%AD%E6%B2%A1%E6%9C%89%E6%8C%87%E6%98%8E%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%EF%BC%8C%E5%B0%86%E4%BD%BF%E7%94%A8%E8%AF%A5%E5%88%97%E6%89%80%E5%9C%A8%E8%A1%A8%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%E4%BD%9C%E4%B8%BA%E8%AF%A5%E5%88%97%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E6%AF%94%E8%BE%83%E8%A7%84%E5%88%99%0A%0A%0A%23%23%23%23%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20%7C%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%A7%A3%E7%A0%81%E8%AF%B7%E6%B1%82%E6%97%B6%E4%BD%BF%E7%94%A8%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%20%7C%0A%7C%20character_set_connection%20%7C%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%A4%84%E7%90%86%E8%AF%B7%E6%B1%82%E6%97%B6%E4%BC%9A%E6%8A%8A%E8%AF%B7%E6%B1%82%E5%AD%97%E7%AC%A6%E4%B8%B2%E4%BB%8Echaracter_set_client%E8%BD%AC%E4%B8%BAcharacter_set_connection%20%7C%0A%7C%20character_set_results%20%7C%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%90%91%E5%AE%A2%E6%88%B7%E7%AB%AF%E8%BF%94%E5%9B%9E%E6%97%B6%E4%BD%BF%E7%94%A8%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%20%7C%0A%0A%E5%B0%86%E4%B8%8A%E8%BF%B03%E4%B8%AA%E7%B3%BB%E7%BB%9F%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE%E6%88%90%E5%90%8C%E4%B8%80%E5%AD%97%E7%AC%A6%E9%9B%86%E7%9A%84%E6%96%B9%E6%B3%95%EF%BC%9A%0A%0A*%20%E6%96%B9%E6%B3%951%EF%BC%9A%0ASET%20NAMES%20%20%E5%AD%97%E7%AC%A6%E9%9B%86%EF%BC%9B%0A%E6%B3%A8%E6%84%8F%EF%BC%8C%E6%AD%A4%E5%91%BD%E4%BB%A4%E4%B8%ADNAMES%E4%B8%8D%E6%98%AF%E7%B3%BB%E7%BB%9F%E5%8F%98%E9%87%8F%EF%BC%8C%E8%80%8C%E4%B8%94%E4%B8%8E%E5%AD%97%E7%AC%A6%E9%9B%86%E5%8F%82%E6%95%B0%E9%97%B4%E4%B8%8D%E8%83%BD%E7%94%A8%3D%E8%BF%9E%E6%8E%A5%0A%0A*%20%E6%96%B9%E6%B3%952%EF%BC%9A%0ASET%20CHARACTER_SET_CLIENT%3D%E5%AD%97%E7%AC%A6%E9%9B%86%0ASET%20CHARACTER_SET_CONNECTION%3D%E5%AD%97%E7%AC%A6%E9%9B%86%0ASET%20CHARACTER_SET_RESULTS%3D%E5%AD%97%E7%AC%A6%E9%9B%86%0A%0A*%20%E6%96%B9%E6%B3%953%EF%BC%9A%0A%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E4%B8%AD%EF%BC%9A%5Bmysql%20%7C%20client%20%5D%E7%BB%84%E4%B8%8B%EF%BC%8Cdefault-character-set%3D%E5%AD%97%E7%AC%A6%E9%9B%86%0A%0A%0A%0A**%E7%8E%B0%E5%9C%A8%E7%9C%8B%E4%B8%80%E4%B8%8B%E5%9C%A8%E8%AF%B7%E6%B1%82%E4%BB%8E%E5%8F%91%E9%80%81%E5%88%B0%E7%BB%93%E6%9E%9C%E8%BF%94%E5%9B%9E%E8%BF%87%E7%A8%8B%E4%B8%AD%E5%AD%97%E7%AC%A6%E9%9B%86%E7%9A%84%E5%8F%98%E5%8C%96%EF%BC%9A**%0A%0A1.%20%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%8F%91%E9%80%81%E8%AF%B7%E6%B1%82%E6%89%80%E4%BD%BF%E7%94%A8%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%0A%E4%B8%80%E8%88%AC%E6%83%85%E5%86%B5%E4%B8%8B%E5%AE%A2%E6%88%B7%E7%AB%AF%E6%89%80%E4%BD%BF%E7%94%A8%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%E5%BD%93%E5%89%8D%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E4%B8%80%E8%87%B4%EF%BC%8C%E4%B8%8D%E5%90%8C%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E4%BD%BF%E7%94%A8%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%8F%AF%E8%83%BD%E4%B8%8D%E4%B8%80%E6%A0%B7%EF%BC%8C%E5%A6%82%E4%B8%8B%EF%BC%9A%0A%0A*%20%E7%B1%BBUnix%E7%B3%BB%E7%BB%9F%E4%BD%BF%E7%94%A8%E7%9A%84%E6%98%AFutf8%0A*%20Windows%E4%BD%BF%E7%94%A8%E7%9A%84%E6%98%AFgbk%0A2.%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%8E%A5%E6%94%B6%E5%88%B0%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%8F%91%E9%80%81%E6%9D%A5%E7%9A%84%E8%AF%B7%E6%B1%82%E5%85%B6%E5%AE%9E%E6%98%AF%E4%B8%80%E4%B8%B2%E4%BA%8C%E8%BF%9B%E5%88%B6%E7%9A%84%E5%AD%97%E8%8A%82%EF%BC%8C%E5%AE%83%E4%BC%9A%E8%AE%A4%E4%B8%BA%E8%BF%99%E4%B8%B2%E5%AD%97%E8%8A%82%E9%87%87%E7%94%A8%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E6%98%AFcharacter_set_client%EF%BC%8C%E5%B0%86%E4%BA%8C%E8%BF%9B%E5%88%B6%E5%AD%97%E8%8A%82%E4%B8%B2%E9%87%87%E7%94%A8character_set_client%E5%AD%97%E7%AC%A6%E9%9B%86%E8%BF%9B%E8%A1%8C%E8%A7%A3%E7%A0%81%EF%BC%8C%E5%BE%97%E5%88%B0%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%9B%0A3.%20%E7%84%B6%E5%90%8E%E9%80%9A%E8%BF%87character_set_connection%E5%AD%97%E7%AC%A6%E9%9B%86%E5%AF%B9%E5%AD%97%E7%AC%A6%E4%B8%B2%E8%BF%9B%E8%A1%8C%E7%BC%96%E7%A0%81%EF%BC%8C%E5%BE%97%E5%88%B0%E4%BA%8C%E8%BF%9B%E5%88%B6%E5%AD%97%E8%8A%82%E4%B8%B2%EF%BC%8C%E9%80%9A%E8%BF%87%E8%AF%A5%E4%BA%8C%E8%BF%9B%E5%88%B6%E5%AD%97%E8%8A%82%E4%B8%B2%E5%8E%BB%E8%A1%A8%E4%B8%AD%E8%BF%9B%E8%A1%8C%E5%88%97%E5%80%BC%E5%A4%84%E7%90%86%EF%BC%88%E5%A6%82%E6%9E%9C%E5%88%97%E4%BD%BF%E7%94%A8%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8Ccharacter_set_connection%E5%AD%97%E7%AC%A6%E9%9B%86%E4%B8%8D%E4%B8%80%E8%87%B4%EF%BC%8C%E8%BF%98%E9%9C%80%E8%A6%81%E5%86%8D%E8%BF%9B%E8%A1%8C%E4%B8%80%E6%AC%A1%E8%BD%AC%E6%8D%A2%EF%BC%89%0A4.%20%E4%B8%8A%E4%B8%80%E6%AD%A5%E4%B8%AD%E6%89%BE%E5%88%B0%E7%9A%84%E5%88%97%E5%80%BC%E5%85%B6%E5%AE%9E%E6%98%AF%E4%B8%80%E4%B8%AA%E4%BA%8C%E8%BF%9B%E5%88%B6%E5%AD%97%E8%8A%82%E4%B8%B2%EF%BC%8C%E7%84%B6%E5%90%8E%E5%86%8D%E4%BD%BF%E7%94%A8%E5%88%97%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E8%BF%9B%E8%A1%8C%E8%A7%A3%E7%A0%81%EF%BC%8C%E5%BE%97%E5%88%B0%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%8C%E5%86%8D%E9%80%9A%E8%BF%87character_set_results%E8%BF%9B%E8%A1%8C%E7%BC%96%E7%A0%81%EF%BC%8C%E5%BE%97%E5%88%B0%E4%BA%8C%E8%BF%9B%E5%88%B6%E5%AD%97%E8%8A%82%E4%B8%B2%E8%BF%94%E5%9B%9E%E7%BB%99%E5%AE%A2%E6%88%B7%E7%AB%AF%EF%BC%9B%0A5.%20%E5%AE%A2%E6%88%B7%E7%AB%AF%E6%A0%B9%E6%8D%AE%E8%BF%94%E5%9B%9E%E7%9A%84%E4%BA%8C%E8%BF%9B%E5%88%B6%E5%AD%97%E8%8A%82%E4%B8%B2%EF%BC%8C%E9%87%87%E7%94%A8%E5%AE%A2%E6%88%B7%E7%AB%AF%E9%BB%98%E8%AE%A4%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E8%BF%9B%E8%A1%8C%E8%A7%A3%E7%A0%81%EF%BC%8C%E5%BE%97%E5%88%B0%E5%AD%97%E7%AC%A6%E5%B1%95%E7%A4%BA%E7%BB%99%E7%94%A8%E6%88%B7%EF%BC%9B%0A%0A%E9%80%9A%E8%BF%87%E4%B8%8A%E9%9D%A2%E7%9A%84%E5%88%86%E6%9E%90%EF%BC%9A%0A%0A*%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%AE%A4%E4%B8%BA%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%8F%91%E9%80%81%E8%BF%87%E6%9D%A5%E7%9A%84%E8%AF%B7%E6%B1%82%E6%98%AF%E7%94%A8character_set_client%E7%BC%96%E7%A0%81%E7%9A%84%E3%80%82%0A%E5%81%87%E8%AE%BE%E4%BD%A0%E7%9A%84%E5%AE%A2%E6%88%B7%E7%AB%AF%E9%87%87%E7%94%A8%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%C2%A0character_set_client%C2%A0%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84%E8%AF%9D%EF%BC%8C%E8%BF%99%E5%B0%B1%E4%BC%9A%E5%87%BA%E7%8E%B0%E6%84%8F%E6%83%B3%E4%B8%8D%E5%88%B0%E7%9A%84%E6%83%85%E5%86%B5%E3%80%82%E6%AF%94%E5%A6%82%E6%88%91%E7%9A%84%E5%AE%A2%E6%88%B7%E7%AB%AF%E4%BD%BF%E7%94%A8%E7%9A%84%E6%98%AFutf8%E5%AD%97%E7%AC%A6%E9%9B%86%EF%BC%8C%E5%A6%82%E6%9E%9C%E6%8A%8A%E7%B3%BB%E7%BB%9F%E5%8F%98%E9%87%8Fcharacter_set_client%E7%9A%84%E5%80%BC%E8%AE%BE%E7%BD%AE%E4%B8%BAascii%E7%9A%84%E8%AF%9D%EF%BC%8C%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%8F%AF%E8%83%BD%E6%97%A0%E6%B3%95%E7%90%86%E8%A7%A3%E6%88%91%E4%BB%AC%E5%8F%91%E9%80%81%E7%9A%84%E8%AF%B7%E6%B1%82%EF%BC%8C%E6%9B%B4%E5%88%AB%E8%B0%88%E5%A4%84%E7%90%86%E8%BF%99%E4%B8%AA%E8%AF%B7%E6%B1%82%E4%BA%86%E3%80%82%0A*%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%B0%86%E6%8A%8A%E5%BE%97%E5%88%B0%E7%9A%84%E7%BB%93%E6%9E%9C%E9%9B%86%E4%BD%BF%E7%94%A8character_set_results%E7%BC%96%E7%A0%81%E5%90%8E%E5%8F%91%E9%80%81%E7%BB%99%E5%AE%A2%E6%88%B7%E7%AB%AF%E3%80%82%0A%E5%81%87%E8%AE%BE%E4%BD%A0%E7%9A%84%E5%AE%A2%E6%88%B7%E7%AB%AF%E9%87%87%E7%94%A8%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E5%92%8C%C2%A0character_set_results%C2%A0%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84%E8%AF%9D%EF%BC%8C%E8%BF%99%E5%B0%B1%E5%8F%AF%E8%83%BD%E4%BC%9A%E5%87%BA%E7%8E%B0%E5%AE%A2%E6%88%B7%E7%AB%AF%E6%97%A0%E6%B3%95%E8%A7%A3%E7%A0%81%E7%BB%93%E6%9E%9C%E9%9B%86%E7%9A%84%E6%83%85%E5%86%B5%EF%BC%8C%E7%BB%93%E6%9E%9C%E5%B0%B1%E6%98%AF%E5%9C%A8%E4%BD%A0%E7%9A%84%E5%B1%8F%E5%B9%95%E4%B8%8A%E5%87%BA%E7%8E%B0%E4%B9%B1%E7%A0%81%E3%80%82%E6%AF%94%E5%A6%82%E6%88%91%E7%9A%84%E5%AE%A2%E6%88%B7%E7%AB%AF%E4%BD%BF%E7%94%A8%E7%9A%84%E6%98%AFutf8%E5%AD%97%E7%AC%A6%E9%9B%86%EF%BC%8C%E5%A6%82%E6%9E%9C%E6%8A%8A%E7%B3%BB%E7%BB%9F%E5%8F%98%E9%87%8Fcharacter_set_results%E7%9A%84%E5%80%BC%E8%AE%BE%E7%BD%AE%E4%B8%BAascii%E7%9A%84%E8%AF%9D%EF%BC%8C%E5%8F%AF%E8%83%BD%E4%BC%9A%E4%BA%A7%E7%94%9F%E4%B9%B1%E7%A0%81%E3%80%82%0A%0A*%20character_set_connection%E5%8F%AA%E6%98%AF%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%9C%A8%E5%B0%86%E8%AF%B7%E6%B1%82%E7%9A%84%E5%AD%97%E8%8A%82%E4%B8%B2%E4%BB%8Echaracter_set_client%E8%BD%AC%E6%8D%A2%E4%B8%BAcharacter_set_connection%E6%97%B6%E4%BD%BF%E7%94%A8%EF%BC%8C%E5%AE%83%E6%98%AF%E4%BB%80%E4%B9%88%E5%85%B6%E5%AE%9E%E6%B2%A1%E5%A4%9A%E9%87%8D%E8%A6%81%EF%BC%8C%E4%BD%86%E6%98%AF%E4%B8%80%E5%AE%9A%E8%A6%81%E6%B3%A8%E6%84%8F%EF%BC%8C%E8%AF%A5%E5%AD%97%E7%AC%A6%E9%9B%86%E5%8C%85%E5%90%AB%E7%9A%84%E5%AD%97%E7%AC%A6%E8%8C%83%E5%9B%B4%E4%B8%80%E5%AE%9A%E6%B6%B5%E7%9B%96%E8%AF%B7%E6%B1%82%E4%B8%AD%E7%9A%84%E5%AD%97%E7%AC%A6%EF%BC%8C%E8%A6%81%E4%B8%8D%E7%84%B6%E4%BC%9A%E5%AF%BC%E8%87%B4%E6%9C%89%E7%9A%84%E5%AD%97%E7%AC%A6%E6%97%A0%E6%B3%95%E4%BD%BF%E7%94%A8character_set_connection%E4%BB%A3%E8%A1%A8%E7%9A%84%E5%AD%97%E7%AC%A6%E9%9B%86%E8%BF%9B%E8%A1%8C%E7%BC%96%E7%A0%81%E3%80%82%E6%AF%94%E5%A6%82%E4%BD%A0%E6%8A%8Acharacter_set_client%E8%AE%BE%E7%BD%AE%E4%B8%BAutf8%EF%BC%8C%E6%8A%8Acharacter_set_connection%E8%AE%BE%E7%BD%AE%E6%88%90ascii%EF%BC%8C%E9%82%A3%E4%B9%88%E6%AD%A4%E6%97%B6%E4%BD%A0%E5%A6%82%E6%9E%9C%E4%BB%8E%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%8F%91%E9%80%81%E4%B8%80%E4%B8%AA%E6%B1%89%E5%AD%97%E5%88%B0%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%8C%E9%82%A3%E4%B9%88%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%97%A0%E6%B3%95%E4%BD%BF%E7%94%A8ascii%E5%AD%97%E7%AC%A6%E9%9B%86%E6%9D%A5%E7%BC%96%E7%A0%81%E8%BF%99%E4%B8%AA%E6%B1%89%E5%AD%97%EF%BC%8C%E5%B0%B1%E4%BC%9A%E5%90%91%E7%94%A8%E6%88%B7%E5%8F%91%E5%87%BA%E4%B8%80%E4%B8%AA%E8%AD%A6%E5%91%8A%E3%80%82</center></span>
</div></body></html> 